home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / f2c / may_5_92.lha / f2c.VMay_5_1992 / libF77 / i_indx.c < prev    next >
C/C++ Source or Header  |  1992-05-07  |  277b  |  25 lines

  1. #include "f2c.h"
  2.  
  3. integer i_indx(a, b, la, lb)
  4. char *a, *b;
  5. ftnlen la, lb;
  6. {
  7. ftnlen i, n;
  8. char *s, *t, *bend;
  9.  
  10. n = la - lb + 1;
  11. bend = b + lb;
  12.  
  13. for(i = 0 ; i < n ; ++i)
  14.     {
  15.     s = a + i;
  16.     t = b;
  17.     while(t < bend)
  18.         if(*s++ != *t++)
  19.             goto no;
  20.     return(i+1);
  21.     no: ;
  22.     }
  23. return(0);
  24. }
  25.